package suanfa;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author zt
 * @date 2020-09-08 22:44
 */
public class TcpSer {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(10000);
        Socket socket = serverSocket.accept();

        InputStream is = socket.getInputStream();
        byte[] bytes = new byte[1024];
        int len = is.read(bytes);
        String length = new String(bytes, 0, len);
        System.out.println("length = " + length);


        socket.close();
    }
}
